﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vds2465Telegrams
{
	public enum eReportSubType_General
	{
		Message,
		Revision	
	}

	public class ReportType_General : ReportType_Base
	{
		#region private member variables

		private eReportSubType_General _reportSubTypeGeneral;

		#endregion private member variables

		#region constructor

		/// <summary>
		/// 
		/// </summary>
		/// <param name="onOffFlag"></param>
		/// <param name="reportSubTypeGeneral"></param>
		public ReportType_General(bool onOffFlag, eReportSubType_General reportSubTypeGeneral)
			: base(onOffFlag)
		{
			_reportSubTypeGeneral = reportSubTypeGeneral;
		}

		#endregion constructor

		#region getters

		public eReportSubType_General ReportSubType { get { return _reportSubTypeGeneral; } }

		#endregion getters

		#region ToString, Equals, GetHashCode

		public override int GetHashCode()
		{
			int hashCode = base.GetHashCode();
			hashCode ^= (byte)ReportSubType;

			return hashCode;
		}

		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("(");
			stringBuilder.Append(ToStringProperties());
			stringBuilder.Append(")");

			return stringBuilder.ToString();
		}

		internal override string ToStringProperties()
		{
			StringBuilder stringBuilder = new StringBuilder();

			stringBuilder.Append(base.ToStringProperties());

			stringBuilder.Append(", ");

			stringBuilder.Append("ReportSubType='");
			stringBuilder.Append(ReportSubType);
			stringBuilder.Append("'");

			return stringBuilder.ToString();
		}

		public override bool Equals(object obj)
		{
			Type objType = obj.GetType();
			if (this.GetType() == objType)
			{
				ReportType_General reportTypeGeneral2Compare = obj as ReportType_General;
				return EqualsProperties(reportTypeGeneral2Compare);
			}

			return false;
		}

		internal bool EqualsProperties(ReportType_General reportTypeGeneral2Compare)
		{
			if (base.EqualsProperties(reportTypeGeneral2Compare))
			{
				return (ReportSubType == reportTypeGeneral2Compare.ReportSubType);
			}
			
			return false;
		}

		#endregion ToString, Equals, GetHashCode
	}
}
